#include <stdio.h>
double inner_product(const double *a, const double *b, int n);
int main(void)
{
    double res;
    double a[5] = {1, 2, 3, 4, 5};
    double b[5] = {1, 2, 3, 4, 5};
    res = inner_product(a, b, 5);
    printf("%g\n", res);
    return 0;
}
double inner_product(const double *a, const double *b, int n) {
    double res = 0;
    for (const double *p = a, *q = b; p < a + n, q < b + n; p++, q++)
        res += *p * *q;
    return res;
}